import React from 'react'
import ReactDOM from 'react-dom'
import Autocomplete from './autocomplete.js'

let App = React.createClass({
  getInitialState () {
    return {
       shopItems: {}
    }
  },

//Autocomplete回调函数，返回Autocomplete选中当前值
  onSelectHandle(item) {
    this.setState({shopItems: item})
  },


  render () {
    return (
      <div>
       <Autocomplete
                placeholder="请输入店铺账号或名称"
                onSelect={this.onSelectHandle}
                requestUrl="/src/javascript/components/autocomplete/mock.json"
              />
      </div>
    )
  }
})

ReactDOM.render(
    <App />,
    document.getElementById('app')
);
